﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DiskClearHelper
{
    public class DriveInfoWrap
    {
        private readonly DriveInfo _driveInfo;
        public DriveInfoWrap(DriveInfo driveInfo)
        {
            _driveInfo = driveInfo;
        }

        public string Name
        {
            get
            {
                return _driveInfo.Name;
            }
        }

        public string VolumeLabel
        {
            get
            {
                return _driveInfo.VolumeLabel;
            }
        }

        public int TotalSize
        {
            get
            {
                return (int)(_driveInfo.TotalSize/1024/1024/1024);
            }
        }

        public double AvailableSize
        {
            get
            {
                double dv =_driveInfo.AvailableFreeSpace;
                double gb=dv / 1024 / 1024 / 1024;
                return gb;
            }
        }

        public double UsedPercentage
        {
            get
            {
                double freeRate = (double)_driveInfo.AvailableFreeSpace / (double)_driveInfo.TotalSize;
                double val = (1-freeRate) * 100;
                return val;
            }
        }

        public DriveInfo DriveInfo
        {
            get
            {
                return _driveInfo;
            }
        }
    }
}
